console.log('hello webpack')

if('serviceWorker' in navigator){
    window.addEventListener('load',()=>{
        navigator.serviceWorker.register('./service-worker.js').then( registration =>{
            console.log('success'+registration)
        }).catch((e)=>{
            console.log('error'+e)
        })
    })
}else {
    console.error('失败')
}